import service from './utils/http'

export const getComment = (params)=>{
    return service({
        url:'find',
        params,
        method:'get'
    })
}

/**
 * 
 * @param {title,content} params 
 */
export const commit = (params)=>{
    return service({
        url:'commit',
        params,
        method:'get'
    })
}
//del/comment
export const delComment = (params)=>{
    return service({
        url:'del/comment',
        params,
        method:'get'
    })
}

//upload-single

export const upload = (data)=>{
    return service({
        url:'upload-single',
        data,
        method:'post'
    })
}
/**
 * 
 * @param {text,content,tags} data 
 */
export const addartical = (data)=>{
    return service({
        url:'add/artical',
        data,
        method:'post'
    })
}
// getArtical

export const getartical = (params)=>{
    return service({
        url:'get/artical',
        params,
        method:'get'
    })
}
//登录
export const usrLogin = (data)=>{
    return service({
        url:'user/login',
        data,
        method:'post'
    })
} 
//注册
export const usrRegister = (data)=>{
    return service({
        url:'user/register',
        data,
        method:'post'
    })
} 